#region Copyright (c) 2006-2012 nHydrate.org, All Rights Reserved
// --------------------------------------------------------------------- *
//                           NHYDRATE.ORG                                *
//              Copyright (c) 2006-2012 All Rights reserved              *
//                                                                       *
//                                                                       *
// This file and its contents are protected by United States and         *
// International copyright laws.  Unauthorized reproduction and/or       *
// distribution of all or any portion of the code contained herein       *
// is strictly prohibited and will result in severe civil and criminal   *
// penalties.  Any violations of this copyright will be prosecuted       *
// to the fullest extent possible under law.                             *
//                                                                       *
// THE SOURCE CODE CONTAINED HEREIN AND IN RELATED FILES IS PROVIDED     *
// TO THE REGISTERED DEVELOPER FOR THE PURPOSES OF EDUCATION AND         *
// TROUBLESHOOTING. UNDER NO CIRCUMSTANCES MAY ANY PORTION OF THE SOURCE *
// CODE BE DISTRIBUTED, DISCLOSED OR OTHERWISE MADE AVAILABLE TO ANY     *
// THIRD PARTY WITHOUT THE EXPRESS WRITTEN CONSENT OF THE NHYDRATE GROUP *
//                                                                       *
// UNDER NO CIRCUMSTANCES MAY THE SOURCE CODE BE USED IN WHOLE OR IN     *
// PART, AS THE BASIS FOR CREATING A PRODUCT THAT PROVIDES THE SAME, OR  *
// SUBSTANTIALLY THE SAME, FUNCTIONALITY AS THIS PRODUCT                 *
//                                                                       *
// THE REGISTERED DEVELOPER ACKNOWLEDGES THAT THIS SOURCE CODE           *
// CONTAINS VALUABLE AND PROPRIETARY TRADE SECRETS OF NHYDRATE,          *
// THE REGISTERED DEVELOPER AGREES TO EXPEND EVERY EFFORT TO             *
// INSURE ITS CONFIDENTIALITY.                                           *
//                                                                       *
// THE END USER LICENSE AGREEMENT (EULA) ACCOMPANYING THE PRODUCT        *
// PERMITS THE REGISTERED DEVELOPER TO REDISTRIBUTE THE PRODUCT IN       *
// EXECUTABLE FORM ONLY IN SUPPORT OF APPLICATIONS WRITTEN USING         *
// THE PRODUCT.  IT DOES NOT PROVIDE ANY RIGHTS REGARDING THE            *
// SOURCE CODE CONTAINED HEREIN.                                         *
//                                                                       *
// THIS COPYRIGHT NOTICE MAY NOT BE REMOVED FROM THIS FILE.              *
// --------------------------------------------------------------------- *
#endregion
namespace nHydrate.Generator.Common.GeneratorFramework
{
  public class BaseUIControl : ModelObjectUserInterface
  {
    protected System.Windows.Forms.Button mBtnCancel;
    protected System.Windows.Forms.Button mBtnApply;
    private System.Windows.Forms.Panel panel1;
    private readonly System.ComponentModel.Container components = null;

    public BaseUIControl()
    {
      InitializeComponent();
    }

    protected override void Dispose(bool disposing)
    {
      if (disposing)
      {
        if (components != null)
        {
          components.Dispose();
        }
      }
      base.Dispose(disposing);
    }

    #region Component Designer generated code
    /// <summary> 
    /// Required method for Designer support - do not modify 
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
      this.mBtnCancel = new System.Windows.Forms.Button();
      this.mBtnApply = new System.Windows.Forms.Button();
      this.panel1 = new System.Windows.Forms.Panel();
      this.panel1.SuspendLayout();
      this.SuspendLayout();
      // 
      // mBtnCancel
      // 
      this.mBtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
      this.mBtnCancel.Enabled = false;
      this.mBtnCancel.Location = new System.Drawing.Point(96, 4);
      this.mBtnCancel.Name = "mBtnCancel";
      this.mBtnCancel.TabIndex = 9;
      this.mBtnCancel.Text = "&Cancel";
      this.mBtnCancel.Click += new System.EventHandler(this.mBtnCancel_Click);
      // 
      // mBtnApply
      // 
      this.mBtnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
      this.mBtnApply.Enabled = false;
      this.mBtnApply.Location = new System.Drawing.Point(8, 4);
      this.mBtnApply.Name = "mBtnApply";
      this.mBtnApply.TabIndex = 8;
      this.mBtnApply.Text = "&Apply";
      this.mBtnApply.Click += new System.EventHandler(this.mBtnApply_Click);
      // 
      // panel1
      // 
      this.panel1.Controls.Add(this.mBtnApply);
      this.panel1.Controls.Add(this.mBtnCancel);
      this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
      this.panel1.Location = new System.Drawing.Point(0, 0);
      this.panel1.Name = "panel1";
      this.panel1.Size = new System.Drawing.Size(176, 32);
      this.panel1.TabIndex = 10;
      // 
      // BaseUIControl
      // 
      this.Controls.Add(this.panel1);
      this.Name = "BaseUIControl";
      this.Size = new System.Drawing.Size(176, 32);
      this.panel1.ResumeLayout(false);
      this.ResumeLayout(false);

    }
    #endregion

    #region Events

    public event StandardEventHandler ApplyButtonClick;
    public event StandardEventHandler CancelButtonClick;

    protected void OnApplyButtonClick(object sender, System.EventArgs e)
    {
      if (this.ApplyButtonClick != null)
        this.ApplyButtonClick(sender, e);
    }

    protected void OnCancelButtonClick(object sender, System.EventArgs e)
    {
      if (this.CancelButtonClick != null)
        this.CancelButtonClick(sender, e);
    }

    #endregion

    #region Button Handlers

    private void mBtnApply_Click(object sender, System.EventArgs e)
    {
      this.OnApplyButtonClick(this, e);
    }

    private void mBtnCancel_Click(object sender, System.EventArgs e)
    {
      this.OnCancelButtonClick(this, e);
    }

    #endregion

  }
}